<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Upload</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/widget.css" />
<link type="text/css" href="css/smoothness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />	

<script src="js/lang/en.js" type="text/javascript"></script>
<script src="js/lang/pt.js" type="text/javascript"></script>

<script src="js/libs/modernizr-2.0.6.min.js"></script>

<script type="text/javascript" src="js/libs/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/libs/jquery.tools.min.js"></script>
<script type="text/javascript" src="js/libs/jquery-ui-1.8.16.custom.min.js"></script>

<script type="text/javascript" src="js/jquery.raty.min.js"></script>
<script type="text/javascript" src="js/cookies.js"></script>
<script type="text/javascript" src="js/base64.js"></script>
<script type="text/javascript" src="js/store.js"></script>
<script type="text/javascript" src="js/signals.js"></script>

<script type="text/javascript" src="js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="js/jquery.fileupload.js"></script>
<script type="text/javascript" src="js/icon_chooser.js"></script>
<script type="text/javascript" src="js/upload.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>


</head>
<body>
<div id="page">
<div class="headerMain">
    <div class="navigationBar">
    	<div class="navigationItem" onclick="goHome()" id="store_link">Widget Store</div>
        <div class="navigationItem" onClick="goToCategorySearch()" id="categories_link">Categories</div>
        <div class="navigationItem" onClick="goToFavourites()" id="favourites_link">Favourites</div>
        <div class="logged-in"><div class="navigationItem" onClick="goToMyWidgets()" id="my_widgets_link">My Widgets</div></div>
        <div class="logged-in"><div class="navigationItemSelected" id="creator_link">Creator</div></div>
        <div class="admin-view"><div class="navigationItem" onClick="goToAdmin()" id="admin_link">Admin</div></div>
        <div class="searchtag" onclick="searchStore();">Search</div>
        <input class="searchBox" type="text" name="q" placeholder="Search term here" id="searchText" />
        <div class="login" id="login"></div>
        <div class="clear"></div>
    </div>
    <div class="clear"> </div>
</div>
<div class="clear"> </div>


	<div class="sectionhead">
		<h2 id="creator_label"></h2>
	</div>
	<div class="section" id="upload_view">
		<div class="logged-in">
			<div id="tabs">
			<ul>
                <li><a href="#tabs-1" id="embed_tab">Embed</a></li>
                <li><a href="#tabs-2" id="web_address_tab">Web Address</a></li>
				<li><a href="#tabs-3" id="imports_tab">Imports</a></li>
                <li><a href="#tabs-4" id="web_folder_tab">Web Folder</a></li>
				<li><a href="#tabs-5" id="widgets_tab">W3C Widgets</a></li>
			</ul>
            <div class="upload-box" id="tabs-1">
				<div class="instruction" id="embed_instruction"><p>
                This form allows you to construct a widget from an embed code for a widget or app that you find on the web.
                </p>
                </div>
                <form id="embedform" action="" method="POST">
                <input type="hidden" id="embedformuser" name="username"/>
                <fieldset>
                <table>
                	<tr>
                    	<td>
                        	<label for="embed" id="embed_label">Paste embed code or any html here:</label>
                        </td>
                        <td>
                        	<textarea rows="5" cols="50" id="embed" name="embed"></textarea>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetname" class="widgetname_label">New Widget Name:</label>
                        </td>
                        <td>
                        	<input type="text" id="widgetname" name="widgetname" size="50"/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="web_icon_chooser" class="iconchooser_label">Choose An Icon:</label>
                        </td>
                     	<td><div id="web_icon_chooser"></div></td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetdescription" class="widgetdescription_label">Widget Description:</label>
                        </td>
                        <td>
                        	<textarea rows="5" cols="50" id="widgetdescription" name="widgetdescription"></textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetwidth" class="widgetwidth_label">Widget Width:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetwidth" name="widgetwidth"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetheight" class="widgetheight_label">Widget Height:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetheight" name="widgetheight"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                    		<!--  <input type="submit" value="Submit"/> -->
                    	</td>
                    	
                    </tr>

                </table>
                    
                </fieldset>
                </form>
                <button onClick="submitEmbed()"><span class="submit_label">Submit</span></button>

            </div>
            <div class="upload-box" id="tabs-2">
				<div class="instruction" id="webaddress_instruction"><p>
                This form allows you to construct a widget from an web address or URL. Copy the address from the location field when on the page you wish to widgetise.  Paste that address into the address field here.  Give the widget a name, description, width and height.  Finally click submit.
                </p>
                </div>
                <form id="webaddressform" action="" method="POST">
                <fieldset>
                <table>
                	<tr>
                    	<td>
                        	<label for="webaddress" id="webaddress_label"></label>
                        </td>
                        <td>
                        	<input type="text" id="webaddress" name="webaddress" size="50"/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetname" class="widgetname_label">New Widget Name:</label>
                        </td>
                        <td>
                        	<input type="text" id="widgetname" name="widgetname" size="50"/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="webaddress_icon_chooser" class="iconchooser_label">Choose An Icon:</label>
                        </td>
                     	<td><div id="webaddress_icon_chooser"></div></td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetdescription" class="widgetdescription_label">Widget Description:</label>
                        </td>
                        <td>
                        	<textarea rows="5" cols="50" id="widgetdescription" name="widgetdescription"></textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetwidth" class="widgetwidth_label">Widget Width:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetwidth" name="widgetwidth"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetheight" class="widgetheight_label">Widget Height:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetheight" name="widgetheight"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                    		<!--  <input type="submit" value="Submit"/> -->
                    	</td>
                    	
                    </tr>

                </table>
                    
                </fieldset>
                </form>
                <button onClick="submitWebAddress()"><span class="submit_label">Submit</span></button>

            </div>

			<div class="upload-box" id="tabs-3">
				<div class="instruction" id="import_instruction">
                </div>
                <form id="mediafileupload" action="" method="POST" enctype="multipart/form-data">
                <input type="hidden" id="hiddenusername" name="username"/>
                <fieldset>
                <table>
                	<tr>
                    	<td>
                        	<label for="mediafile" class="choosefile_label"></label>
                        </td>
                        <td>
                        	<input id="mediafile" type="file" name="mediafile" multiple/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetname" class="widgetname_label">New Widget Name:</label>
                        </td>
                        <td>
                        	<input type="text" id="widgetname" name="widgetname" size="50"/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="flash_icon_chooser" class="iconchooser_label">Choose An Icon:</label>
                        </td>
                     	<td><div id="flash_icon_chooser"></div></td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetdescription" class="widgetdescription_label">Widget Description:</label>
                        </td>
                        <td>
                        	<textarea rows="5" cols="50" id="widgetdescription" name="widgetdescription"></textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetwidth" class="widgetwidth_label">Widget Width:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetwidth" name="widgetwidth"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetheight" class="widgetheight_label">Widget Height:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetheight" name="widgetheight"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                    		<!--  <input type="submit" value="Submit"/> -->
                    	</td>
                    	
                    </tr>

                </table>
                    
                </fieldset>
                </form>
                <button onClick="submitMedia()"><span class="submit_button">Submit</span></button>
			</div>
            <div class="upload-box" id="tabs-4">
				<div class="instruction" id="webfolder_instruction">
                </div>
                <form id="sitefileupload" action="" method="POST" enctype="multipart/form-data">
                <input type="hidden" id="hiddenusername" name="username"/>
                <fieldset>
                <table>
                	<tr>
                    	<td>
                        	<label for="sitefile" class="choosefile_label">Choose A File:</label>
                        </td>
                        <td>
                        	<input id="sitefile" type="file" name="sitefile" multiple/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetname" class="widgetname_label">New Widget Name:</label>
                        </td>
                        <td>
                        	<input type="text" id="widgetname" name="widgetname" size="50"/>
                        </td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="general_icon_chooser" class="iconchooser_label">Choose An Icon:</label>
                        </td>
                     	<td><div id="general_icon_chooser"></div></td>
                     </tr>
                     <tr>
                     	<td>
                        	<label for="widgetdescription" class="widgetdescription_label">Widget Description:</label>
                        </td>
                        <td>
                        	<textarea rows="5" cols="50" id="widgetdescription" name="widgetdescription"></textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetwidth" class="widgetwidth_label">Widget Width:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetwidth" name="widgetwidth"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                        	<label for="widgetheight" class="widgetheight_label">Widget Height:</label>
                        </td>
                        <td>
                        	<input type="number" id="widgetheight" name="widgetheight"/>
                        </td>
                    </tr>
                    <tr>
                    	<td>
                    		<!--  <input type="submit" value="Submit"/> -->
                    	</td>
                    	
                    </tr>

                </table>
                    
                </fieldset>
                </form>
                <button onClick="submitSite()"><span class="submit_label">Submit</span></button>


            </div>
			<div class="upload-box" id="tabs-5">
				<input id="fileupload" type="file" name="widgetFile" multiple/>
			</div>
           </div>
			<div id="upload_percent"></div>
			</div>		
          </div>
		<div class="not-logged-in">
			<div class="message" id="loggedin_message">You must be logged in to upload widgets, gadgets or other media</div>
		</div>
	</div>
<div class="clear">&nbsp;</div>


<footer>
&nbsp;
</footer>

</div>

<div id="fileSelector">
	<div class="fileNameChooserMessage" id="fileNameChooserMessage"></div>
    <div id="fileNameChooser"></div>
    <button onClick="cancelSelectFileName()">Cancel</button>
    <button onClick="selectAFileNameAndBuild()">Select</button>
</div>

</body>
</html>